<template>
	<view>
		<rich-text :nodes="nodes"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				key: '',
				nodes: [{
					name: 'div',
					attrs: {
						class: 'div-class',
						style: 'line-height: 60px; color: red; text-align:center;'
					},
					children: [{
						type: 'text',
						text: ''
					}]
				}],
			}
		},
		onLoad(num) {
			this.about_api()
			uni.setStorageSync('isRead', 1)
		},
		methods: {
			async about_api() {
				var that = this
				const {
					data
				} = await this.$request(this.$Api.indexContent, {

				}, "POST")
				var richtext = data.data.text
				const regex = new RegExp('<img', 'gi');
				richtext = richtext.replace(regex, `<img style="max-width: 100%;"`)
				this.nodes = richtext;
				// indexContent

			},
		}
	}
</script>

<style>

</style>